package ALBasicProtocolPack.BasicObj;

import java.nio.ByteBuffer;

import ALBasicProtocolPack._IALProtocolStructure;


/**********************
 * 协议处理类，使用模板方式定义，可直接生成对应的消息结构体并进行处理
 * 
 * @author alzq.z
 * @email  zhuangfan@vip.163.com
 * @time   Feb 19, 2013 10:56:34 AM
 */
public abstract class _AALBasicProtocolSubOrderNoProtocolDealer
{
    public _AALBasicProtocolSubOrderNoProtocolDealer()
    {
    }
	
	/**********************
	 * 消息处理函数，直接带入对应的消息结构体
	 * 
	 * @author alzq.z
	 * @time   Feb 19, 2013 10:52:30 AM
	 */
    public void dealProtocol(_IALProtocolReceiver _receiver, _IALProtocolStructure _msg)
    {
    	if(null == _msg)
    		return ;

    	//模仿MainOrder处理
    	ByteBuffer fullBuffer = _msg.makeFullPackage();
    	//读取2个前编号字节
    	fullBuffer.get();
    	fullBuffer.get();
    	
    	//进行实际处理
    	dealProtocol(_receiver, fullBuffer);
    }
    
	/*********************
	 * 消息带入的处理函数，将协议从字节中读取出并带入实际处理函数
	 * 
	 * @author alzq.z
	 * @time   Feb 19, 2013 10:52:19 AM
	 */
	public abstract void dealProtocol(_IALProtocolReceiver _receiver, ByteBuffer _msgBuffer);
}
